package example_10.setdemo;

import java.util.*;

public class SetDemo_02 {
    public static void main(String[] args) {
//        又一个一维数组，要求去处数组中的重复数据
        String[] names =
                {"a","s","d","a","s","a","d","g","h"};
//        禁止使用循环
        List<String> a = Arrays.asList(names);
        Set<String> b = new HashSet<>();
        b.addAll(a);
        System.out.println(b);

        /*String[] strs = new String[b.size()];
        strs = b.toArray(strs);
        System.out.println(strs[0]);*/

    }
}
